package org.nokatag.password;
/**
 * 將字串轉成十六進位表示法
 * @author wife
 */
public class Msg {
	public static String toHexString(byte[] b) {
		StringBuffer hexString = new StringBuffer();
		String plainText;

		for (int i = 0; i < b.length; i++) {
			plainText = Integer.toHexString(0xFF & b[i]);
			if (plainText.length() < 2) {
				plainText = "0" + plainText;
			}
			hexString.append(plainText);
		}
		return hexString.toString();
	}
}